(function() {
	'use strict';

	angular
		.module('skymate.settings')
		.run(['$rootScope', '$localStorage', function($rootScope, $localStorage) {
			// Global Settings
			// ----------------------------------- 
			$rootScope.app = {
				name: 'Skymate-Admin',
				description: '前端模板',
				year: ((new Date()).getFullYear()),
				layout: {
					isFixed: true,
					isCollapsed: false,
					isBoxed: false,
					isRTL: false,
					horizontal: false,
					isFloat: false,
					asideHover: false,
					theme: null,
					asideScrollbar: false
				},
				useFullLayout: false,
				hiddenFooter: false,
				offsidebarOpen: false,
				asideToggled: false,
				viewAnimation: 'ng-fadeInUp'
			};

			// Setup the layout mode
			$rootScope.app.layout.horizontal = ($rootScope.$stateParams.layout === 'app-h');

			// Close submenu when sidebar change from collapsed to normal
			$rootScope.$watch('app.layout.isCollapsed', function(newValue) {
				if (newValue === false)
					$rootScope.$broadcast('closeSidebarMenu');
			});
		}]);
})();